// Hardware Buffer
// (c) jimon game studio

#ifndef JEH_IHARDWAREBUFFER
#define JEH_IHARDWAREBUFFER

#include "IBuffer.h"
#include "je3dTypes.h"

namespace je
{
	namespace video
	{
		//! Hardware Buffer, for VBO and etc
		class IHardwareBuffer:public je::core::IBuffer
		{
		public:
			//! Destructor
			virtual ~IHardwareBuffer()
			{
			}

			//! Merge Data with this scheme :
			//! data block from current buffer - Ci, data block size = Stride - ObjectSize
			//! our new data block for merge - Ni, count of blocks = ArraySize / ObjectSize
			//! method create new array :
			//! C1N1C2N2C3N3C4N4C5N5...CnNn
			//! no offset for this method
			virtual void Merge(const void * Pointer,u32 ArraySize,u32 ObjectSize,u32 Stride) = 0;

			//! Get merged data blocks
			virtual void UnMerge(void * Pointer,u32 ArraySize,u32 ObjectSize,u32 Stride,u32 Offset) = 0;

			//! Return true if hardware buffer enable
			virtual u1 IsHardwareBufferEnable() = 0;

			//! Set auto update options
			virtual void BufferAutoUpdateOptions(u1 FromHWtoSWwhileLock,u1 FromSWtoHWwhileUnlock) = 0;

			//! move data from software buffer to hardware buffer
			virtual void MoveFromSoftwareToHardware() = 0;

			//! move data from hardware buffer to software buffer
			virtual void MoveFromHardwareToSoftware() = 0;

			//! Get Data Type
			virtual Graphics3dDataType GetDataType() = 0;

			//! Copy Buffer to a new context or something else
			virtual IHardwareBuffer * CopyAndRecreateBuffer() = 0;

			//! Get pointer to data
			virtual void * GetPtr() = 0;
		};
	}
}

#endif
